/* 
 * Spring mixin mybatis frame code general
 * Fu(iknoweth@yahoo.com) All rights reserved 
 * 
 */
package com.pricl.biz.file.entity;

import java.io.Serializable;

import com.wordnik.swagger.annotations.ApiModel;
import com.wordnik.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * <strong>附件信息表</strong>Data Entity
 * </p>
 *
 */  
@ApiModel(value="附件信息")
public class FileInfo implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 8683336962857232514L;

	//正式环境的图片地址
	public static final String ossPath = "http://chiguadata.oss-cn-shenzhen.aliyuncs.com";
	
	//测试环境的图片地址
	//public static final String ossPath = "http://cdttest.oss-cn-shanghai.aliyuncs.com";

	/**
	 * 自定义方法
	 * 
	 * @return
	 */
	public String getFileName() {
		return String.format("%s.%s", id, extName);
	}
	
	@ApiModelProperty(value="附件url")
	private String fileUrl;
	
	public String getFileUrl() {
		//阿里云的服务器地址
		fileUrl = null;
		if(path !=null){
			fileUrl = ossPath + path + "/" + String.format("%s.%s", id, extName);
		}
		return fileUrl;
	}
	
	
	/** 文件id **/
	private java.lang.String id;

	/** 文件名 **/
	@ApiModelProperty(value="附件名")
	private java.lang.String name;

	/** 源文件id **/
	private java.lang.String oid;

	/** 源文件名 **/
	private java.lang.String oname;

	/** 文件大小 **/
	@ApiModelProperty(value="附件大小")
	private java.lang.Long length;

	/** 文件类型 **/
	@ApiModelProperty(value="附件类型")
	private java.lang.String contentType;

	/** 扩展名 **/
	@ApiModelProperty(value="扩展名")
	private java.lang.String extName;

	/** 存储路径 **/
	@ApiModelProperty(value="存储路径")
	private java.lang.String path;

	/** 创建日期 **/
	@ApiModelProperty(value="附件创建日期")
	private java.util.Date createdDt;

	/** 更改日期 **/
	@ApiModelProperty(value="更新日期")
	private java.util.Date updatedDt;

	/** 状态:1-正常，9-删除 **/
	@ApiModelProperty(value="状态:1-正常，9-删除")
	private java.lang.Integer status;
	
	/** 音频，视频 文件的时长 **/
	@ApiModelProperty(value="音频，视频 文件的时长")
	private java.lang.Long duration;
	
	public java.lang.String getId() {
		return id;
	}

	public void setId(java.lang.String id) {
		this.id = id;
	}

	public java.lang.String getName() {
		return name;
	}

	public void setName(java.lang.String name) {
		this.name = name;
	}

	public java.lang.String getOid() {
		return oid;
	}

	public void setOid(java.lang.String oid) {
		this.oid = oid;
	}

	public void setOname(java.lang.String oname) {
		this.oname = oname;
	}

	public java.lang.String getOname() {
		return this.oname;
	}

	public void setLength(java.lang.Long length) {
		this.length = length;
	}

	public java.lang.Long getLength() {
		return this.length;
	}

	public void setContentType(java.lang.String contentType) {
		this.contentType = contentType;
	}

	public java.lang.String getContentType() {
		return this.contentType;
	}

	public void setExtName(java.lang.String extName) {
		this.extName = extName;
	}

	public java.lang.String getExtName() {
		return this.extName;
	}

	public void setPath(java.lang.String path) {
		this.path = path;
	}

	public java.lang.String getPath() {
		return this.path;
	}

	public void setCreatedDt(java.util.Date createdDt) {
		this.createdDt = createdDt;
	}

	public java.util.Date getCreatedDt() {
		return this.createdDt;
	}

	public void setUpdatedDt(java.util.Date updatedDt) {
		this.updatedDt = updatedDt;
	}

	public java.util.Date getUpdatedDt() {
		return this.updatedDt;
	}

	public void setStatus(java.lang.Integer status) {
		this.status = status;
	}

	public java.lang.Integer getStatus() {
		return this.status;
	}

	public java.lang.Long getDuration() {
		return duration;
	}

	public void setDuration(java.lang.Long duration) {
		this.duration = duration;
	}
}
